package d1202.Ljs1;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Demo1 {
    public static void main(String[] args) {
        int[] arr={80,98,87,65,32};
        ArrayList<Integer>integers=new ArrayList<>();
        System.out.println("排序前："+Arrays.toString(arr));
        for (int i = 0; i < arr.length; i++) {
            integers.add(arr[i]);
        }
        Collections.sort(integers, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1 ;
            }
        });
        System.out.println("排序后："+integers);
    }
}
